#ifndef _MODELCLASS_H_
#define _MODELCLASS_H_


#include "Helper.h"

using namespace std;

class Model
{
private:
	struct Vertex
	{
		D3DXVECTOR3 position;
	    D3DXVECTOR2 texture;
		D3DXVECTOR3 normal;
	};

	struct Face
	{
		float x, y, z;
		float tu, tv;
		float nx, ny, nz;
	};

public:
	Model();
	~Model();

	bool Initialize(ID3D10Device*, WCHAR*, char*);
	void Shutdown();
	void Render(ID3D10Device*);

	int GetIndexCount();
	ID3D10ShaderResourceView* GetTexture();

private:
	bool InitializeBuffers(ID3D10Device*);
	void ShutdownBuffers();
	void RenderBuffers(ID3D10Device*);

	bool LoadTexture(ID3D10Device*, WCHAR*);
	void ReleaseTexture();

	bool LoadModel(char*);
	void ReleaseModel();

private:
	ID3D10Buffer *pVertexBuffer, *pIndexBuffer;
	ID3D10ShaderResourceView* pTextureRV;

	int nVertexCount, nIndexCount;
	Face* pFace;

    ID3DX10Mesh* pMesh;
};

#endif
